<?php

class AcctCategoryTable extends Doctrine_Table
{
    //取会计科目类别
    public function getAcctCategories() {
        //$q = Doctrine_Query::create()->from("AcctCategory")
        $q = $this->createQuery()
                ->orderBy("AcctCategory.id");
        return $q->execute();
    }

    public function getAcctCategoriesAssoc() {
        $categories_arr = array();
        $categories = $this->getAcctCategories();
        foreach($categories as $category) {
            $categories_arr[$category->getId()] = $category->getCategoryName();
        }

        return $categories_arr;
    }

}
